<template>
  <div class="pt-20">
    <!-- <div class="w100 rows rowsm bgff mb-20">
        <div class="br-16 rowsc rowsm fs-16 fw-b h-40" style="width: 50%;" :style="active == 0 ? 'background-color: #E33636;color:#fff;' : 'background-color: #fff;'" @click="active = 0">驳回</div>
        <div class="br-16 rowsc rowsm fs-16 fw-b h-40" style="width: 50%;" :style="active == 1 ? 'background-color: #E33636;color:#fff;' : 'background-color: #fff;'" @click="active = 1">督促</div>
    </div> -->
    <div class="" v-if="active == 0">
        <div class="w100 p-all-20 rowsb rowsm bgff br-16 mb-20" v-for="(item,index) in list1" :key="index">
            <div class="rowscl">
                <div class="fs-16 fw-b col333 mb-6">{{item.name}}</div>
                <div class="fs-12 col666">{{item.createTime}}</div>
            </div>
            <div class="col666 fs-14">分类:{{item.type}}</div>
            <div class="w-80 h-30 br-15 rowsc rowsm fw-b fs-12" style="border: 1px solid #E33636;color: #E33636;">已驳回</div>
        </div>
    </div>

    <div class="" v-if="active == 1">
        <div class="w100 p-all-20 rowsb rowsm bgff br-16 mb-20" v-for="(item,index) in list2" :key="index">
            <div class="rowscl">
                <div class="fs-16 fw-b col333 mb-6">{{item.title}}</div>
                <div class="fs-12 col888">{{item.content}}</div>
            </div>
            <div class="rowscl">
                <div class="w-80 h-30 br-15 rowsc rowsm fw-b fs-12 mb-6" style="border: 1px solid #E33636;color: #E33636;" @click="confirm(item.id)" v-if="item.subStatus == 1">确认</div>
                <div class="w-80 h-30 br-15 rowsc rowsm fw-b fs-12 mb-6" style="border: 1px solid #E33636;color: #E33636;" @click="confirm(item.id)" v-else>已确认</div>
                <div class="fs-12 col888">{{item.createTime}}</div>
            </div>
        </div>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
        active:1,
        list1:[],
        list2:[]
    };
  },
  watch: {},
  computed: {},
  methods: {
    confirm(id){
        this.$axios.post('prouserdc/subDc',{id}).then(res => {
            this.$notify({
                title: '提示',
                message: res.data.msg
            });
            if(res.data.code != 200) return
            setTimeout(() => {
                this.getList()
            },1000)
        })
    },
    getList(){
        this.$axios.post('prold/listReject',{}).then(res => {
            if(res.data.code != 200) return this.$notify({
                title: '提示',
                message: res.data.msg
            });
            let {rows} = res.data
            this.list1 = rows
        })

        this.$axios.post('prouserdc/list',{}).then(res => {
            if(res.data.code != 200) return this.$notify({
                title: '提示',
                message: res.data.msg
            });
            let {rows} = res.data
            this.list2 = rows
        })
    }
  },
  created() {
    this.getList()
  },
  mounted() {}
};
</script>
<style lang="scss" scoped>
</style>